Instructions for replicating "Monetary Policy and Home Buying Inequality" by Daniel Ringo



*******************************************************
Data
*******************************************************

To run the replication files, researchers will need to obtain access to two sources of data: confidential HMDA files and proprietary individual rate locks data from Optimal Blue LLC.  Confidential HMDA data are available only to researchers affiliated with federal regulators of mortgage lenders - interested researchers will need to follow their particular agency's instructions for obtaining access.  Researchers can contact Optimal Blue LLC (Sales@OptimalBlue.com) to discuss purchasing the rate locks data.

Once access has been obtained, researchers should store each years' HMDA loan application record data for which action type = 1 in the "data" folder in their working directory in Stata .dta format.  For years 1990-2018, each year's data should be named in the following convention:

hmYY_action1.dta

where YY is the last two digits of the reporting year.  The 2019 data should be named:

hmdav_lar_dynamic_2019.dta

Depending on the naming conventions the user's agency employs for their particular version of the data, users may need to adjust variable names to match those used in the code.  The file "HMDA public documentation.xlsx" provides a data dictionary for years 1990-2018.  For 2019, use "cfpb_reportable-hmda-data_regulatory_and_reporting_overview_reference-chart-2019.pdf"

The individual rate locks data should be stored in the "data" folder as: 

optimal_blue_locks.dta

Depending on how the data is transferred from the vendor, variable names may need to be adjusted to match the code.  The file "Copy of Locks_Data_Dictionary.xlsx" can be used for this purpose.

Additional data files for census-tract and MSA-level information from the Census Bureau are included and should be saved in the "data" folder.  They are:

1. Census2019.csv
-> Tract-level income data for 2019 produced by the FFIEC from American Community Survey data
2. msa19inc.csv
-> FFIEC estimated area median family incomes for 2019
3. zcta2010.txt
-> Census-provided crosswalk between census tracts and ZIP codes.

Monetary policy shock series estimated by Swanson (2021), Jarocinski (2021), and Lewis (2023) should also be saved in the "data" folder.  These are:

1. pre-and-post-ZLB-factors-extended.xlsx
-> Swanson (2021) shocks
2. U1s.csv
-> Jarocinski (2021) shocks
3. Shocks_web.xlxs - Shocks.csv
-> Lewis (2023) shocks

Finally, estimates of MSA-specific housing supply elasticities from Saiz (2010), the file "saiz.dta", should be saved in the "data" folder.


*******************************************************
Code
*******************************************************

All the code for this project was run on Stata version 18.0.

The file "master.do" in Stata will run each of the files listed below in sequence.  They take in the raw data and produce all the table outputs and figures in the paper.  To run, the user should save all files with a ".do" extension in the "code" folder in their working directlry, and edit the first line of "master.do" to change directory to the appropriate file path.

1. merge_optimal_hmda_14_19.do
-> Performs the loan-level merge between rate locks in the Optimal Blue data and originations in the HMDA data
2. tract_hmda_dta
-> Creates census-tract/year level data to merge in at the loan level
3. coapp.do
-> Measures the presence of a co-applicant in the HMDA data
4. hmda_sumstats.do
-> Creates a temporary datafile for producing summary statistics from HMDA
5. make_weekly_series_act.do
-> Creates a weekly time series of HMDA originations for the local projections estimator
6. cleanup.do
-> Merges the Swanson (2021) monetary policy shocks data, prime rate, tract, and zipcode level data together with the loan-level merge created in step 1
7. tables_main.do
-> Produces the summary statistics and regression outputs for all the tables in the main text
8. figure_firststage.do
-> Creates Figure 1
9. fig_reducedform.do
-> Creates Figures 2 and 4
10. fig_reducedform_first.do
-> Creates Figure 3
11. lp52.do
-> Creates Figure 5 and Appendix Figure A.3
12. counts.do
-> Creates Figure 6
13. jarocinski.do
-> a) Calls subroutine cleanup_jarocinski.do
-> -> Merges the Jarocinski (2021) monetary policy shocks data, prime rate, tract, and zipcode level data together with the loan-level merge created in step 1
-> b) Calls subroutine fig_firststage_jarocinski.do
-> -> Produces Appendix Figure A.1
-> c) Produces the regression outputs for Appendix Table A.1 
14. lewis.do
-> a) Calls subroutine cleanup_lewis.do
-> -> Merges the Lewis (2023) monetary policy shocks data, prime rate, tract, and zipcode level data together with the loan-level merge created in step 1
-> b) Calls subroutine fig_firststage_lewis.do
-> -> Produces Appendix Figure A.2
-> c) Produces the regression outputs for Appendix Table A.2 
15. appendix_tables.do
-> a) Produces the regression outputs for Appendix Tables A.3 through A.10
-> b) calls subroutine eight_weeks.do to merge the Swanson (2021) monetary policy shocks data, prime rate, tract, and zipcode level data together with the loan-level merge created in step 1 over a broader, 8-week time window


